﻿using System;
using System.Web.Mvc;

namespace Pronghorn.Core
{
	public class ProngHornViewResult : ViewResult
	{
		public new ViewDataDictionary<IProngHornSkinContext> ViewData
		{
			get; set;
		}

		public override void ExecuteResult(ControllerContext context)
		{
			//This is not nice I should write a custom ActionInvoker that knows about ProngHorn
			if (context.GetType() != typeof(ProngHornControllerContext))
			{
			    throw new ArgumentException("ProngHornViewResult expects a ProngHornControllerContext");
			}
			var pronghornContext = context as ProngHornControllerContext;
			//TODO: Call to the ViewEngine

			//TODO: ViewEngine does the rendering into the Response.
			context.HttpContext.Response.Write("Hello from the ProngHornView result");
		}
	}
}